package com.ruyiadmin.springboot.entity_data_model.entity_model.system_model;

import com.baomidou.mybatisplus.annotation.*;
import com.ruyiadmin.springboot.common_infrastructure.models.base_entity_model.RuYiAdminBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 行政区域实体模型
 *
 * @author RuYiAdmin
 * @since 2022-07-11
 */
@TableName("sys_area")
@ApiModel(value = "SysArea对象", description = "行政区域表")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysArea extends RuYiAdminBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableField("AREA_CODE")
    @ApiModelProperty("地区编码")
    @NotNull
    @Length(max = 6)
    private String AreaCode;

    @TableField("PARENT_AREA_CODE")
    @ApiModelProperty("父地区编码")
    @NotNull
    @Length(max = 6)
    private String ParentAreaCode;

    @TableField("AREA_NAME")
    @ApiModelProperty("地区名称")
    @NotNull
    @Length(max = 50)
    private String AreaName;

    @TableField("ZIP_CODE")
    @ApiModelProperty("邮政编码")
    @NotNull
    @Length(max = 50)
    private String ZipCode;

    @TableField("AREA_LEVEL")
    @ApiModelProperty("地区层级(1省份 2城市 3区县)")
    @NotNull
    private int AreaLevel;

}
